package com.example.controller;

import com.example.common.Result;
import com.example.entity.Notice;
import com.example.service.NoticeService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/notice")
public class NoticeController {

    @Resource
    private NoticeService noticeService;

    @PostMapping("/findByNotice")
    public Result findByNotice (Notice notice){
        List<Notice> noticeList = noticeService.findNotice(notice);
        return Result.success(noticeList);
    }

    @PostMapping("/addnotice")
    public Result addNotice (@RequestBody Notice notice){
        noticeService.addNotice(notice);
        return Result.success();
    }



}
